This was unintentional, and lead to a memory leak.
{
GtkEntryPrivate *priv;
GObject *obj;
+ gboolean had_buffer = FALSE;
g_return_if_fail (GTK_IS_ENTRY (entry));
if (priv->buffer)
{
+ had_buffer = TRUE;
buffer_disconnect_signals (entry);
g_object_unref (priv->buffer);
}
g_object_notify_by_pspec (obj, entry_props[PROP_INVISIBLE_CHAR_SET]);
g_object_thaw_notify (obj);
- gtk_editable_set_position (GTK_EDITABLE (entry), 0);
- gtk_entry_recompute (entry);
+ if (had_buffer)
+ {
+ gtk_editable_set_position (GTK_EDITABLE (entry), 0);
+ gtk_entry_recompute (entry);
+ }
}
/**